<template>
  <div class="List">
      <van-grid :column-num="5">
      <van-grid-item
        v-for="(v, index) in Arr"
        :key="index"
        :icon="v.pic"
        :text="v.title"
        @click="fun(index)"/>
    </van-grid>
    <div class="Listone">
      <img
        src="https://pic.cdfgsanya.com/assets/upload/visual/fb5424f4976d43c6bcaaa1fa8c1e13de.png?1675593700887"
        alt=""
      />
    </div>
  </div>
</template>

<script>
import service from '../../../utils/service'
export default {
  name: "List",
  data() {
    return {
      Arr: [
        // {
        //   src: "https://pic.cdfgsanya.com/assets/upload/visual/9a679dae844810590a7274d6cdd7ec46.png?1672733335540",
        //   msg: "护肤",
        // },
        // {
        //   src: "https://pic.cdfgsanya.com/assets/upload/visual/f1e623a756133f47263ec39abf473fc1.png?1672733343676",
        //   msg: "彩妆",
        // },
        // {
        //   src: "https://pic.cdfgsanya.com/assets/upload/visual/c095fd65aed3a246b2ac587bfcab5975.png?1672733415327",
        //   msg: "香水",
        // },
        // {
        //   src: "https://pic.cdfgsanya.com/assets/upload/visual/aa449d54726de45f799ea18d5295dfad.png?1672733423774",
        //   msg: "箱包",
        // },
        // {
        //   src: "https://pic.cdfgsanya.com/assets/upload/visual/5ea97f014427190797b7c32b80ad58de.png?1672733434773",
        //   msg: "腕表首饰",
        // },
        // {
        //   src: "https://pic.cdfgsanya.com/assets/upload/visual/f888b0284520fe3dcde5c65d5e6e1e6f.png?1672733339350",
        //   msg: "酒水",
        // },
        // {
        //   src: "https://pic.cdfgsanya.com/assets/upload/visual/9b68b97488d7baaf2d0b5d229f02e410.png?1672733488317",
        //   msg: "手机数码",
        // },
        // {
        //   src: "https://pic.cdfgsanya.com/assets/upload/visual/9b68b97488d7baaf2d0b5d229f02e410.png?1672733488317",
        //   msg: "点击领劵",
        // },
        // {
        //   src: "https://pic.cdfgsanya.com/assets/upload/visual/f94db7cc8c5b7aec57742744e6e562f4.png?1672733427118",
        //   msg: "个人家居",
        // },
        // {
        //   src: "https://pic.cdfgsanya.com/assets/upload/visual/a227c21d43a1bdf02ca3e410deb1bec8.png?1675572897152",
        //   msg: "国潮新尚",
        // },
      ],
    };
  },
  mounted() {
    service({
      url: "navlist",
      method: "get",
    }).then((res) => {
      // console.log(res.data);
      // res.data.navlist.forEach(element => {
      //     this.Arr.push(element);
      // });
      this.Arr = res.data;
    });   
  },
   methods: {
    fun(myid) {
      console.log(myid);
      if( myid==9){
        this.$router.push({ name: "Gcsspage", params: { yf: myid } });
      }
    },
  },
};
</script>

<style scoped>
.List{
  margin-top: 54px;
}
.List .Listone {
  width: 375px;
  margin-top: 10px;
  margin-bottom: 5px;
}
.List .Listone > img {
  width: 100%;
}
</style>